package com.itheima.feign.goods;


import entity.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "goods-service")
public interface GoodsFeign {

    @GetMapping("/goods/{id}")
    Result findById(@PathVariable("id") Long id);

    @PostMapping("/goods/buy")
    Result buy(@RequestParam("goodId") Long id,
               @RequestParam("buyNum") Integer buyNum);
}
